/*
 * DisplayLuaImage.java
 * Created on December 24, 2007, 3:55 AM by Uru
 *
 * Works much like a combintaion between DisplayStringImage and DisplayLuaText
 * the image name string is stored in a in Lua instead of Java
 */

package MenuSystem;

import java.awt.*;
import javax.swing.*;
import ImageSystem.ImageRegistry;
import LuaSystem.LuaEngine;

public class DisplayLuaImage implements SelfDrawing{
    protected String var;
    
    //Creates a new instance of DisplayImage
    public DisplayLuaImage(String name) {
        var = name;
    }
    
    //draws the image
    public void draw(Graphics2D g, int mx, int my, JComponent screen){
        String tag = LuaEngine.getGlobalString(var);
        if(tag != null){
            ImageRegistry.drawImage(tag,mx,my,g,screen);
        }
    }
    
}
